package com.shsubway.activity.com;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.shsubway.R;
import com.shsubway.activity.manger.HomeActivity;
import com.shsubway.base.BaseActivity;
import com.shsubway.utils.Constant;

import cn.bmob.v3.Bmob;
import cn.sharesdk.framework.ShareSDK;
import cn.smssdk.SMSSDK;

public class StartActivity extends BaseActivity {
    Handler handler;
    Runnable runnable;
    Intent intent;
    Bundle bundle;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        Bmob.initialize(this, "dd62ba00b95de9ed37a5e432623372f6");
//        ShareSDK.initSDK(context,"1c07637bb6737");
        ShareSDK.initSDK(this);
        SMSSDK.initSDK(this, "1bed1a3059a07", "5626ca6c8704c8bc4416517d2fee9c06");
        intent = new Intent();
        bundle = new Bundle();
        intent.putExtras(bundle);
        handler = new Handler();
        runnable = new Runnable() {
            @Override
            public void run() {
                if ((Boolean) get(Constant.ISLOGIN, false)) {
                    intent.setClass(context, HomeActivity.class);
                } else {
                    intent.setClass(context, LoginActivity.class);
                }
                startActivity(intent);
                finish();
            }
        };
        handler.postDelayed(runnable, 3500);

    }
}
